import dotenv from 'dotenv'
import fs from 'fs'
import path from 'path'
dotenv.config()
/**
 * 配置项
 */
export const APP_PORT: string = process.env.APP_PORT || '3000'
export const MYSQL_HOST: string = process.env.MYSQL_HOST || 'localhost'
export const MYSQL_PORT: string = process.env.MYSQL_PORT || '3306'
export const MYSQL_DATABASE: string = process.env.MYSQL_DATABASE || 'coderhub'
export const MYSQL_USER: string = process.env.MYSQL_USER || 'root'
export const MYSQL_PASSWORD: string = process.env.MYSQL_PASSWORD || '123456'

/**
 * 公钥密钥
 */
export const PRIVATE_KEY: Buffer = fs.readFileSync(path.resolve(__dirname, './keys/private.key'))
export const PUBLIC_KEY: Buffer = fs.readFileSync(path.resolve(__dirname, './keys/public.key'))
